package com.ssy.lingxi.search.entity;

import lombok.Getter;
import lombok.Setter;

import javax.persistence.*;
import java.io.Serializable;

/**
 * 商城的商品收藏
 * @author jw.chen
 * @version 2.0.0
 * @date 2020/9/25
 */
@Getter
@Setter
@Entity
@Table(schema = "public", name = "product_shop_commodity_collect", indexes = {@Index(name = "product_shop_commodity_collect_m_id_m_r_id_u_id_idx", columnList = "memberId,memberRoleId,userId"),
        @Index(name = "product_shop_commodity_collect_commodity_id_idx", columnList = "commodityId"),
        @Index(name = "product_shop_commodity_collect_shop_id_idx", columnList = "shopId")})
public class CommodityCollect implements Serializable {
    private static final long serialVersionUID = -6635852147758365387L;
    /**
     * 主键id
     */
    @Id
    @GeneratedValue(strategy= GenerationType.SEQUENCE, generator="shop_commodity_collect_seq")
    @SequenceGenerator(sequenceName="product_shop_commodity_collect_seq", name="shop_commodity_collect_seq",allocationSize = 1)
    private Long id;

    /**
     * 商品id
     */
    @Column(columnDefinition = "int8", nullable = false)
    private Long commodityId;

    /**
     * 会员id
     */
    @Column(columnDefinition = "int8", nullable = false)
    private Long memberId;

    /**
     * 会员名称
     */
    @Column(columnDefinition = "varchar(50)", nullable = false)
    private String memberName;

    /**
     * 会员角色id
     */
    @Column(columnDefinition = "int8", nullable = false)
    private Long memberRoleId;

    /**
     * 会员角色名称
     */
    @Column(columnDefinition = "varchar(50)", nullable = false)
    private String memberRoleName;

    /**
     * 用户id
     */
    @Column(columnDefinition = "int8", nullable = false)
    private Long userId;

    /**
     * 用户名称
     */
    @Column(columnDefinition = "varchar(50)", nullable = false)
    private String userName;

    /**
     * 创建时间
     */
    @Column(columnDefinition = "int8", nullable = false)
    private Long createTime = System.currentTimeMillis();

    /**
     * 商城id
     */
    @Column(columnDefinition = "int8", nullable = false)
    private Long shopId;

}
